]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell: Fallback on ISO 8601 datetime string for screenshot date info
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 1 Apr 2019 16:06:49 +0000 (18:06 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 2 Apr 2019 00:25:39 +0000 (00:25 +0000)
If the locale doesn't honor strftime()'s %c argument, we would end up
feeding NULLs into GdkPixbuf tagging. Fallback to a sensible (although
not nicely localized) datetime string.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1017
src/shell-screenshot.c

index 61fdc1d1eeb0b07bfcbd2f12df05237b2c53b7d1..c9743f42d6deb45e44fd3c2516833bad086f2b91 100644 (file)
@@ -202,6 +202,9 @@ write_screenshot_thread (GTask        *result,
                                             cairo_image_surface_get_height (priv->image));
       creation_time = g_date_time_format (priv->datetime, "%c");
 
+      if (!creation_time)
+        creation_time = g_date_time_format (priv->datetime, "%FT%T%z");
+
       if (gdk_pixbuf_save_to_stream (pixbuf, stream, "png", NULL, NULL,
                                      "tEXt::Software", "gnome-screenshot",
                                      "tEXt::Creation Time", creation_time,